{{- $active := index (.Scratch.Get "Active") "Menu" -}}

<header class="header">
    <div class="info">
        <a class="avatar" href="/">
            <div class="bg shadow"></div>
            <img class="bg rainbow" src="/img/rainbow64@3x.webp">
            <img class="avatar" src="{{ .Site.Params.avatar }}">
        </a>
        <a class="title" href="/">
            <p class="text site-title">{{ .Site.Params.Author }}</p>
            <p class="sub up">{{ index .Site.Params.Description 0 }}</p>
            <p class="sub dw">{{ index .Site.Params.Description 1 }}</p>
        </a>
    </div>
    <nav class="menu">
    {{- range .Site.Menus.main -}}
        {{- $url := .URL -}}
        {{- if ne (substr $url -1 1) "/" -}}
            {{- $url = add $url "/" -}}
        {{- end -}}
        <a class="nav-item {{ if eq $active $url }}active{{ end }}" href="{{ $url }}">{{ .Name }}</a>
    {{- end -}}
    </nav>
</header>